package com.agentworkflow.engine.core.enums;

import lombok.Getter;

/**
 * 流程元素类型枚举
 */
@Getter
public enum ElementType {
    /**
     * 节点元素
     */
    NODE("node", "节点"),

    /**
     * 连线元素
     */
    SEQUENCE("sequence", "连线");

    private final String code;
    private final String displayName;

    ElementType(String code, String displayName) {
        this.code = code;
        this.displayName = displayName;
    }

    public static ElementType fromCode(String code) {
        for (ElementType type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return null;
    }
}
